<template>
  <div class="sale-apps-list">
    <div class="head">
      <span class="title">应用上架</span>
      <div class="tabs">
        <span class="tab"
              @click="curTab = 'ongoing'"
              :class="{ active: curTab === 'ongoing' }">进行中</span>
        <span class="tab"
              @click="curTab = 'completed'"
              :class="{ active: curTab === 'completed' }">已完成</span>
        <span class="tab"
              @click="curTab = 'all'"
              :class="{ active: curTab === 'all' }">全部</span>
      </div>
    </div>
    <div class="apps">
      <div v-for="app in apps" class="app">
        <img :src="app.img" class="app-img" alt="">
        <div class="app-name">{{app.name}}</div>
        <div class="app-detail">
          <div class="detail-item">
            <span class="detail-name">单号：</span>
            <span class="detail-value">{{app.id}}</span>
          </div>
          <div class="detail-item">
            <span class="detail-name">版本：</span>
            <span class="detail-value">{{app.version}}</span>
          </div>
          <div class="detail-item">
            <span class="detail-name">更新：</span>
            <span class="detail-value">{{app.updateTime}}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "appSaleList",
    data() {
      return {
        curTab: 'ongoing',
        apps: [
          {
            id: 'zz20190917001',
            name: '固定资产管理',
            version: 'V4.1.0',
            updateTime: '2020-10-12 10:00',
            img: 'http://localhost:8000/static/img/default.e250dfc0.png'
          },
          {
            id: 'zz20190917001',
            name: '固定资产管理',
            version: 'V4.1.0',
            updateTime: '2020-10-12 10:00',
            img: 'http://localhost:8000/static/img/default.e250dfc0.png'
          },
          {
            id: 'zz20190917001',
            name: '固定资产管理',
            version: 'V4.1.0',
            updateTime: '2020-10-12 10:00',
            img: 'http://localhost:8000/static/img/default.e250dfc0.png'
          },
          {
            id: 'zz20190917001',
            name: '固定资产管理',
            version: 'V4.1.0',
            updateTime: '2020-10-12 10:00',
            img: 'http://localhost:8000/static/img/default.e250dfc0.png'
          },
          {
            id: 'zz20190917001',
            name: '固定资产管理',
            version: 'V4.1.0',
            updateTime: '2020-10-12 10:00',
            img: 'http://localhost:8000/static/img/default.e250dfc0.png'
          },
          {
            id: 'zz20190917001',
            name: '固定资产管理',
            version: 'V4.1.0',
            updateTime: '2020-10-12 10:00',
            img: 'http://localhost:8000/static/img/default.e250dfc0.png'
          },
          {
            id: 'zz20190917001',
            name: '固定资产管理',
            version: 'V4.1.0',
            updateTime: '2020-10-12 10:00',
            img: 'http://localhost:8000/static/img/default.e250dfc0.png'
          },
          {
            id: 'zz20190917001',
            name: '固定资产管理',
            version: 'V4.1.0',
            updateTime: '2020-10-12 10:00',
            img: 'http://localhost:8000/static/img/default.e250dfc0.png'
          },
        ]
      }
    }
  }
</script>

<style lang="scss" scoped>
  .sale-apps-list {
    margin: auto;
    max-width: 1260px;
    padding: 30px 0;
  }

  .head {
    margin-bottom: 20px;
    font-weight: 600;
    flex: 0 0 auto;

    .title {
      display: inline-block;
      color: #000000;
      font-size: 20px;
    }

    .tabs {
      display: inline-block;
      margin-left: 40px;
      vertical-align: top;
    }

    .tab {
      display: inline-block;
      margin-right: 30px;
      padding-bottom: 5px;
      border-bottom: 2px solid transparent;
      cursor: pointer;
      transition: all 0.5s;

      &.active {
        color: #336CFB;
        border-bottom-color: #336CFB;
        cursor: initial;
      }
    }
  }

  .apps {
    margin-right: -40px;
  }

  .app {
    display: inline-block;
    width: 220px;
    height: 280px;
    margin: 0 40px 40px 0;
    background:rgba(255,255,255,1);
    box-shadow: 0 5px 10px 0 rgba(0,0,0,0.05);
    border-radius: 6px;
    border: 1px solid rgba(219,223,230,1);
    font-size: 0;
  }

  .app-img {
    width: 100%;
    height: 160px;
    border-radius: 6px 6px 0 0;
  }

  .app-name {
    margin: 14px 14px 10px;
    color: #000000;
    font-weight: 600;
    font-size: 16px;
  }

  .app-detail {
    margin: 10px 14px 14px;
    font-size: 12px;
    color: #999999;

    .detail-item {
      margin: 4px 0;
    }
  }
</style>